def calculate_average(*args):
    if not args:
        return 0
    return sum(args) / len(args)

avg = calculate_average(10, 20, 30, 40)
print(f"平均值为: {avg}")

students = [('Alice', 88), ('Bob', 95), ('Charlie', 82)]
sorted_by_score = sorted(students, key=lambda student: student[1], reverse=True)

print(f"\n按分数降序排序后的学生列表: {sorted_by_score}")